package cate.game.role.res.forge.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import cate.game.role.res.forge.RoleForge;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "设置一键合成装备上限 的 请求")
public class ForgeConfigReq implements MsgInput {
    @NoteField("装备部位")
    public byte pos;
    @NoteField("装备品质")
    public int quality = 5;
    @NoteField("装备星级")
    public int star;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<RoleForge> r = cc.getRole().getRes().forge.forgeConfig(pos, quality, star);
        if (r.ok()) {
            r.data.noticeUpdate();
        } else {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.EQUIP_BATCH_FORGE_LIMIT_REQ;
    }
}
